package com._54programer.ioc.config.config.register;


import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.ComponentScans;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.FilterType;

@Configuration
/**
 * @ComponentScans
 * @ComponentScan  values:指定要扫描的包, 可以多次使用
 * excludeFilters = Filter[] ：指定扫描的时候按照什么规则排除那些组件
 * includeFilters = Filter[] ：指定扫描的时候只需要包含哪些组件
 *      FilterType.ANNOTATION：按照注解
 *      FilterType.ASSIGNABLE_TYPE：按照给定的类型；
 *      FilterType.ASPECTJ：使用ASPECTJ表达式
 *      FilterType.REGEX：使用正则指定
 *      FilterType.CUSTOM：使用自定义规则
 */
@ComponentScans(value = {
        @ComponentScan(value = {"com._54programer.ioc"}, includeFilters = {
                //@ComponentScan.Filter(type = FilterType.ANNOTATION, classes = {Controller.class})//只扫描Controller.class及子类
                //@ComponentScan.Filter(type = FilterType.ASSIGNABLE_TYPE, classes = {PersonService.class}) 只扫描PersonService.class及其子类
                @ComponentScan.Filter(type = FilterType.CUSTOM, classes = {MyTypeFilter.class}) //自动过滤规则
        }, useDefaultFilters = false)
})
public class BeanConfig2 {


}
